#ifndef BASICCARD_H
#define BASICCARD_H

#include "card.h"
#include <map>
#include <string>

using std::string;
using std::map;

#define MaxLit 12
#define MaxYor 13
#define MaxCha 14
#define MaxGit 15
#define MaxKry 16

class CPicture : public CCard
{
public:
	typedef enum
	{
		AucOpen,
		AucRound,
		AucSecret,
		AucDouble,
		AucFixed,
	} T_Auction;
	typedef enum
	{
		TypeLiteMetal,
		TypeGit,
		TypeChan,
		TypeYori,
		TypeKrypto
	} T_PicType;

	T_Auction Auc;
	T_PicType Type;

public:
	CPicture() {}
	CPicture(T_Auction au, T_PicType ty) : Auc(au), Type(ty) {}
	string GetFullName()
	{
		static string NameAuc[5] = {"Open", "Round", "Sealed", "Double", "Fixed"};
		static string NamePicFull[5] = {"Lite Metal", "Yoko", "Christin P", "Karl Gitter", "Krypto"};
		static string NamePic[5] = {"Lit", "Yok", "Chr", "Kar", "Kry"};
		string name = NamePic[Type] + "|" + NameAuc[Auc];
		return name;
	}
};


class CBasicCard
{
public:
	CCardSet Pics;
	map<CCard::T_CardIndex, CPicture*> PicMap;

	CPicture PicsLit[MaxLit];
	CPicture PicsYor[MaxYor];
	CPicture PicsCha[MaxCha];
	CPicture PicsGit[MaxGit];
	CPicture PicsKry[MaxKry];

	CBasicCard() 
	{
		int i;
		for (i = 0; i < MaxLit; i ++)
		{
			PicsLit[i] = CPicture(CPicture::AucDouble, CPicture::TypeLiteMetal);
			Pics.push_back(&PicsLit[i]);
		}
		for (i = 0; i < MaxYor - 2; i ++)
		{
			PicsYor[i] = CPicture(CPicture::AucFixed, CPicture::TypeYori);
			Pics.push_back(&PicsYor[i]);
		}
		PicsYor[MaxYor - 2] = CPicture(CPicture::AucDouble, CPicture::TypeYori);
		Pics.push_back(&PicsYor[MaxYor - 2]);
		PicsYor[MaxYor - 1] = CPicture(CPicture::AucDouble, CPicture::TypeYori);
		Pics.push_back(&PicsYor[MaxYor - 1]);

		for (i = 0; i < MaxCha - 2; i ++)
		{
			PicsCha[i] = CPicture(CPicture::AucOpen, CPicture::TypeChan);
			Pics.push_back(&PicsCha[i]);
		}
		PicsCha[MaxCha - 2] = CPicture(CPicture::AucDouble, CPicture::TypeChan);
		Pics.push_back(&PicsCha[MaxCha - 2]);
		PicsCha[MaxCha - 1] = CPicture(CPicture::AucDouble, CPicture::TypeChan);
		Pics.push_back(&PicsCha[MaxCha - 1]);

		for (i = 0; i < MaxGit - 2; i ++)
		{
			PicsGit[i] = CPicture(CPicture::AucRound, CPicture::TypeGit);
			Pics.push_back(&PicsGit[i]);
		}
		PicsGit[MaxGit - 2] = CPicture(CPicture::AucDouble, CPicture::TypeGit);
		Pics.push_back(&PicsGit[MaxGit - 2]);
		PicsGit[MaxGit - 1] = CPicture(CPicture::AucDouble, CPicture::TypeGit);
		Pics.push_back(&PicsGit[MaxGit - 1]);

		for (i = 0; i < MaxKry - 2; i ++)
		{
			PicsKry[i] = CPicture(CPicture::AucSecret, CPicture::TypeKrypto);
			Pics.push_back(&PicsKry[i]);
		}
		PicsKry[MaxKry - 2] = CPicture(CPicture::AucDouble, CPicture::TypeKrypto);
		Pics.push_back(&PicsKry[MaxKry - 2]);
		PicsKry[MaxKry - 1] = CPicture(CPicture::AucDouble, CPicture::TypeKrypto);
		Pics.push_back(&PicsKry[MaxKry - 1]);

		Pics.AssignIndex();
		for (CCardSet::iterator it = Pics.begin(); it != Pics.end(); it++)
		{
			PicMap[(*it)->Index] = static_cast<CPicture *>(*it);
		}
	}
};














#endif